﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using VgoCardChange.Models;
using VgoCardChange.Models.Objects;

namespace VgoCardChange.Controllers
{
    public class TransactionLogController : Controller
    {
        //
        // GET: /TransactionLog/

        public ActionResult Index()
        {
            return View();
        }
        public ActionResult GetTransactionLog()
        {
            TransactionLogModels TrMd = new TransactionLogModels();
            List<TransactionLog> ListTrL = new List<TransactionLog>();
            ListTrL =TrMd.GetTransactionLog();
            ViewData["listtransactionlog"] = ListTrL;
            return View();
        }
        public ActionResult SearchTran()
        {
            return View();
        }
        [HttpPost]
        public ActionResult SearchTran(string search ,string txtsearch)
        {
            TransactionLogModels TrMd = new TransactionLogModels();
            
            if (search.Equals("TransID"))
            {
                List<TransactionLog> ListsearchTrL = new List<TransactionLog>();
                ListsearchTrL = TrMd.SearchTranID(txtsearch);
                ViewData["ListsearchTrL"] = ListsearchTrL;
            }
            else
                if(search.Equals("UserName"))
            {
                List<TransactionLog> ListsearchTrL = new List<TransactionLog>();
                ListsearchTrL=TrMd.SearchUserName(txtsearch);
                ViewData["ListsearchTrL"] = ListsearchTrL;
            }
     
      
            return View();
 
        }
    }
}
